home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 November: Tool Chest / Dev.CD Nov 96 TC / Dev.CD Nov 96 TC.toast / Sample Code / QuickTime / JPEG Sample / Headers / Proto.h < prev   
Encoding:
C/C++ Source or Header  |  1996-05-22  |  6.0 KB  |  172 lines  |  [TEXT/MPCC]

  1. /*************************************************************************************
  2. #
  3. #        Proto.h
  4. #
  5. #        This file contains the prototypes for the apps procs and funcs
  6. #
  7. #        Author(s):     Michael Marinkovich & Guillermo Ortiz
  8. #                    Apple Developer Technical Support
  9. #                    marink@apple.com
  10. #
  11. #        Modification History: 
  12. #
  13. #            4/3/96        MWM     Initial coding                     
  14. #
  15. #        Copyright © 1992-96 Apple Computer, Inc., All Rights Reserved
  16. #
  17. #
  18. #        You may incorporate this sample code into your applications without
  19. #        restriction, though the sample code has been provided "AS IS" and the
  20. #        responsibility for its operation is 100% yours.  However, what you are
  21. #        not permitted to do is to redistribute the source as "DSC Sample Code"
  22. #        after having made changes. If you're going to re-distribute the source,
  23. #        we require that you make it clear in the source that the code was
  24. #        descended from Apple Sample Code, but that you've made changes.
  25. #
  26. *************************************************************************************/
  27.  
  28. #include <Displays.h>
  29. #include <ImageCompression.h>
  30.  
  31.  
  32. //----------------------------------------------------------------------
  33. //
  34. //    JPEG
  35. //
  36. //----------------------------------------------------------------------
  37.  
  38. OSErr            ReadJPEG(FSSpec spec, CGrafPtr *newWorld);
  39. OSErr            ConvertJPEG(Handle image, CGrafPtr *newWorld);
  40. OSErr             GetJPEGDescription(Handle image, ImageDescriptionHandle desc, Rect *bounds);
  41. OSErr             NewJPEGWorld(GWorldPtr *theWorld, short depth, Rect theRect);
  42. OSErr             DoSaveJPEG(WindowRef window);
  43. pascal OSErr     DataUnloadProc(Ptr data, long bytesNeeded, long refCon);
  44.  
  45.  
  46. //----------------------------------------------------------------------
  47. //
  48. //    Aevt
  49. //
  50. //----------------------------------------------------------------------
  51.  
  52. OSErr             AEInit(void);
  53. pascal OSErr    DoAEOpenApp(AppleEvent event,AppleEvent reply,long refCon);
  54. pascal OSErr    DoAEQuitApp(AppleEvent event,AppleEvent reply,long refCon);
  55. pascal OSErr    DoAEOpenDoc(AppleEvent event,AppleEvent reply,long refCon);
  56. pascal OSErr    DoAEPrintDoc(AppleEvent event,AppleEvent reply,long refCon);
  57. OSErr             GotAEParams(AppleEvent *appleEvent);
  58.  
  59.  
  60. //----------------------------------------------------------------------
  61. //
  62. //    Initialize
  63. //
  64. //----------------------------------------------------------------------
  65.  
  66. OSErr            Initialize(void);
  67. void            ToolBoxInit(void);
  68. void             CheckEnvironment(void);
  69. OSErr             InitApp(void);
  70. void             MenuSetup(void);
  71.  
  72.  
  73. //----------------------------------------------------------------------
  74. //
  75. //    Main
  76. //
  77. //----------------------------------------------------------------------
  78.  
  79.  
  80. void             HandleError(short errNo,Boolean fatal);
  81. void             HandleAlert(short alertID);
  82.  
  83.  
  84. //----------------------------------------------------------------------
  85. //
  86. //    Events
  87. //
  88. //----------------------------------------------------------------------
  89.  
  90. void            EventLoop(void);
  91. short             MyGetSleep(void);
  92. void             CustomWindowEvent(short eventType,WindowRef window,void *refCon);
  93. void             DoEvent(EventRecord *event);
  94. void             DoIdle(WindowRef window, void *refCon);
  95. void             HandleMouseDown( EventRecord *event );
  96. void             HandleMenuChoice( WindowRef window, void *refCon );
  97. void            HandleContentClick( WindowRef window, void *refCon );
  98. void             HandleZoomClick( WindowRef window, void *refCon );
  99. void             HandleGrow(WindowRef window, void *refCon);
  100. void             UpdateWindow(WindowRef window);
  101. void             DoActivate(WindowRef window, void *refCon);
  102.  
  103.  
  104. //----------------------------------------------------------------------
  105. //
  106. //    Windows
  107. //
  108. //----------------------------------------------------------------------
  109.  
  110. WindowPtr         CreateWindow(short resID, void *wStorage, Rect *bounds, Str255 title,
  111.                             Boolean visible, short procID,short kind, WindowRef behind,
  112.                             Boolean goAwayFlag,long refCon);
  113. OSErr             RemoveWindow(WindowRef window);
  114. void             NewWindowTitle(WindowRef window, Str255 str);
  115. OSErr             InitWindowProcs(WindowRef window, short windKind);
  116. GWorldPtr        PictToWorld(PicHandle pict, OSErr *rtnErr);
  117. void            DrawWindow( WindowRef window, void *refCon );
  118. void             DrawAboutWindow( WindowRef window, void *refCon );
  119. void             DoResizeWindow (WindowRef window);
  120. short             GetWindKind(WindowRef window);
  121. Boolean            GetIsAppWindow(WindowRef window);
  122. Boolean         GetIsAboutWindow( WindowRef window );
  123.  
  124.  
  125. //----------------------------------------------------------------------
  126. //
  127. //    Displays
  128. //
  129. //----------------------------------------------------------------------
  130.  
  131. OSErr             InstallDMNotification(void);
  132. OSErr             InstallAEDMNotification(void);
  133. OSErr             RemoveDMNotification(void);
  134. OSErr             InstallDMNotificationAE(void);
  135. pascal OSErr     WorldChangedProc(AppleEvent *event);
  136. pascal OSErr     DoAEDisplayUpdate(AppleEvent event,AppleEvent reply,long refCon);
  137. OSErr             HandleNotification(AppleEvent *event);
  138. OSErr             HandleDeviceChange(DisplayIDType displayID, Rect *newRect);
  139. Boolean         OutOfBoundsRect(GDHandle gd, WindowRef window, Rect screenRect);
  140. void             MoveInbounds(WindowRef window, GDHandle gd, Rect screenRect);
  141. void            ResizeInbounds(WindowRef window, GDHandle gd, Rect screenRect);
  142. GDHandle         GetGreatestDevice(WindowRef window);
  143. void             GetWindowRect(WindowRef window, Rect *windRect);
  144. void             ResetStdState(WindowRef window);
  145.  
  146.  
  147. //----------------------------------------------------------------------
  148. //
  149. //    Scrolls
  150. //
  151. //----------------------------------------------------------------------
  152.  
  153. void             InstallScrollBars(WindowRef window, DocHnd doc);
  154. void             AdjustScrollValues(WindowRef window);
  155. void             AdjustScrollbars(WindowRef window, Boolean resize);
  156. pascal void     ScrollActionProc(ControlRef control, short part);
  157. void            ScrollPict(short hAmount,short vAmount,WindowRef window);
  158. void             MyScrollPicture(WindowRef window, short hs, short vs);
  159. void             GetContRect(WindowRef window,Rect *contRect);
  160.  
  161.  
  162. //----------------------------------------------------------------------
  163. //
  164. //    Utils
  165. //
  166. //----------------------------------------------------------------------
  167.  
  168. void            DoOpenNew(void);    
  169. PicHandle         ReadFile(FSSpec spec);
  170. void            ZeroRect(Rect *r);
  171. void             pstrcpy(StringPtr dst, StringPtr src);
  172. void             pstrcat(StringPtr dst, StringPtr src);